/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author shinji
 */
@Embeddable
public class RoleRightsPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_Rights")
    private int iDRights;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_Role")
    private int iDRole;

    public RoleRightsPK() {
    }

    public RoleRightsPK(int iDRights, int iDRole) {
        this.iDRights = iDRights;
        this.iDRole = iDRole;
    }

    public int getIDRights() {
        return iDRights;
    }

    public void setIDRights(int iDRights) {
        this.iDRights = iDRights;
    }

    public int getIDRole() {
        return iDRole;
    }

    public void setIDRole(int iDRole) {
        this.iDRole = iDRole;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) iDRights;
        hash += (int) iDRole;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RoleRightsPK)) {
            return false;
        }
        RoleRightsPK other = (RoleRightsPK) object;
        if (this.iDRights != other.iDRights) {
            return false;
        }
        if (this.iDRole != other.iDRole) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.RoleRightsPK[ iDRights=" + iDRights + ", iDRole=" + iDRole + " ]";
    }
    
}
